package  
{
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFieldType;
	import style.TextStyle;
	/**
	 * ...
	 * @author jun
	 */
	public class MMText extends MMLabel 
	{
		private var _width:Number;
		private var _height:Number;
		public function MMText(vWidth:Number=100,vHeight:Number=100,vTextStyle:TextStyle = null) 
		{
			_width = vWidth;
			_height = vHeight;
			super(vTextStyle);
		}
		
		override public function regResource():void
		{
			super.regResource();
		}
		
		override public function onInit():void
		{
			super.onInit();
			//textField.width = _width;
			//textField.height = _height;
			textField.autoSize = TextFieldAutoSize.NONE;
			textField.multiline = true;
			textField.wordWrap = true;
			
		}
		
		public function set textWidth(value:Number):void
		{
			_width = value;
			update();
		}
		
		
		public function set textHeight(value:Number):void
		{
			_height = value;
			update();
		}
		
		
		
		override public function onHide():void
		{
			super.onHide();
		}
		
		override public function onShow():void
		{
			super.onShow();
			update();
		}
		
		override public function updateData():void
		{
			super.updateData();
			if (textField.width != _width)
				textField.width = _width;
			if(textField.height !=_height)
				textField.height = _height;
		}
		
	}

}